<style>
    #allotmentCapital-update {
        padding: 20px 25px 25px 0;
    }
</style>
<div class="layui-fluid" id="allotmentCapital-update">
    <form class="layui-form" action="" lay-filter="allotmentCapital-update-form">
        <div class="layui-form-item website-hide">
            <label class="layui-form-label website-form-item-require">id：</label>
            <div class="layui-input-block">
                <input type="text" name="allotmentCapitalId" data-th-value="${allotmentCapital.allotmentCapitalId}">
            </div>
        </div>
        <div class="layui-form-item ">
            <div class="layui-row">
                <div class="layui-col-md12">
                    <label class="layui-form-label website-form-item-require">课题：</label>
                    <div class="layui-input-block">
                        <select name="declareId" lay-search lay-verify="required">
                            <option value="">请选择</option>
                            <option
                                    th:each="item : ${declareTopicList}"
                                    th:value="${item.declareId}" th:text="${item.name}">
                            </option>
                        </select>
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-row">
                <div class="layui-col-md6">
                    <label class="layui-form-label website-form-item-require">主持人：</label>
                    <div class="layui-input-block">
                        <input type="text" name="hostPeople" lay-verify="required" maxlength="10" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-col-md6">
                    <label class="layui-form-label website-form-item-require">拨付时间：</label>
                    <div class="layui-input-block">
                        <input type="text" name="allotmentTime" lay-verify="required" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-row">
                <div class="layui-col-md6">
                    <label class="layui-form-label website-form-item-require">拨付金额(万元)：</label>
                    <div class="layui-input-block">
                        <input type="text" name="allotmentMoney" lay-verify="required|money" autocomplete="off" class="layui-input">
                    </div>
                </div>
                <div class="layui-col-md6">
                    <label class="layui-form-label website-form-item-require">本次累计拨付金额(万元)：</label>
                    <div class="layui-input-block">
                        <input type="text" name="cumulativeMoney" lay-verify="required|money" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item">
            <div class="layui-row">
                <div class="layui-col-md6">
                    <label class="layui-form-label website-form-item-require">总金额(万元)：</label>
                    <div class="layui-input-block">
                        <input type="text" name="totalMoney" lay-verify="required|money" autocomplete="off" class="layui-input">
                    </div>
                </div>
            </div>
        </div>
        <div class="layui-form-item website-hide">
            <button class="layui-btn" lay-submit="" lay-filter="allotmentCapital-update-form-submit" id="submit"></button>
        </div>
    </form>
</div>

<script data-th-inline="javascript">
    layui.use(['website', 'form', 'formSelects', 'validate'], function () {
        var $ = layui.$,
            website = layui.website,
            layer = layui.layer,
            formSelects = layui.formSelects,
            form = layui.form,
            allotmentCapital = [[${allotmentCapital}]],
            $view = $('#allotmentCapital-update'),
            validate = layui.validate;
        form.verify(validate);
        form.render();
        initAllotmentCapitalValue();
        formSelects.render();
        function initAllotmentCapitalValue() {
            form.val("allotmentCapital-update-form", {
                "allotmentCapitalId": allotmentCapital.allotmentCapitalId,
                "declareId": allotmentCapital.declareId,
                "hostPeople": allotmentCapital.hostPeople,
                "allotmentTime": allotmentCapital.allotmentTime,
                "allotmentMoney": allotmentCapital.allotmentMoney,
                "cumulativeMoney": allotmentCapital.cumulativeMoney,
                "totalMoney": allotmentCapital.totalMoney
            });
        }
        form.on('submit(allotmentCapital-update-form-submit)', function (data) {
            website.post(ctx + 'allotmentCapital/update', data.field, function () {
                layer.closeAll();
                website.alert.success('数据修改成功');
                $('#website-allotmentCapital').find('#query').click();
            });
            return false;
        });
    });
</script>